/*
 * File:   testReview.cpp
 * Author: Javier
 *
 * Created on Feb 10, 2015, 8:06:54 AM
 */

#include "testReview.h"
#include "../Review.h"


CPPUNIT_TEST_SUITE_REGISTRATION(testReview);

testReview::testReview() {
}

testReview::~testReview() {
}

void testReview::setUp() {
}

void testReview::tearDown() {
}

void testReview::testConstructor() {
    string userID = "test1";
    string hotelName = "test2";
    string hotelAddress = "test3";
    string comment = "test4";
    int stars = 99;
    
    Review r(userID, hotelName, hotelAddress, comment, stars);
    
    CPPUNIT_ASSERT_EQUAL(userID, r.getUserID());
    CPPUNIT_ASSERT_EQUAL(hotelName, r.getHotelName());
    CPPUNIT_ASSERT_EQUAL(hotelAddress, r.getHotelAddress());
    CPPUNIT_ASSERT_EQUAL(comment, r.getComment());
    CPPUNIT_ASSERT_EQUAL(stars, r.getStars());
}

void testReview::testGet()
{
    Review r("test1","test2","test3","test4",99);
    CPPUNIT_ASSERT(r.getUserID() == "test1");
    CPPUNIT_ASSERT(r.getHotelName() == "test2");
    CPPUNIT_ASSERT(r.getHotelAddress() == "test3");
    CPPUNIT_ASSERT(r.getComment() == "test4");
    CPPUNIT_ASSERT(r.getStars() == 99);
}

void testReview::testSet()
{
    Review r;
    r.setUserID("test1");
    r.setHotelName("test2");
    r.setHotelAddress("test3");
    r.setComment("test4");
    r.setStars(99);
    
    CPPUNIT_ASSERT(r.getUserID() == "test1");
    CPPUNIT_ASSERT(r.getHotelName() == "test2");
    CPPUNIT_ASSERT(r.getHotelAddress() == "test3");
    CPPUNIT_ASSERT(r.getComment() == "test4");
    CPPUNIT_ASSERT(r.getStars() == 99);
}

